<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="utf-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" href="layui/css/layui.css">
		<style type="text/css">
			#pageNum{
				height: 22px;
				text-align: center;
				border: none;
			}
			#ppp{
				font-size: 14px;
				display: inline-block;
				position: relative;
				top:5px
			}
		</style>
	</head>
	<body>
		<div id="app">
			<div class="layui-form">
				<table class="layui-table" lay-size="lg">
					<colgroup>
						<col width="140">
						<col width="140">
						<col width="140">
						<col width="140">
						<col width="140">
						<col width="160">
					</colgroup>
					<thead>
						<tr height="60px">
							<th>序号</th>
							<th>物品名称</th>
							<th>所属分类</th>
							<th>价格</th>
							<th>所属用户</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody id="tbd">
					<c:forEach items="${pageBean.data}" var="g">
						<tr>

							<td>${g.id}</td>
							<td>${g.goodname}</td>
							<td>${g.catename}</td>
							<td>${g.price}</td>
							<td>${g.username}</td>
							<td>
<%--								<button class="layui-btn" @click="findGoodsById(i)" data-toggle="modal" data-target="#i"><i class="layui-icon" ></i></button>--%>
<%--								<button class="layui-btn layui-btn-danger" @click="deleteGoods(i.gid)"><i class="layui-icon"></i></button>--%>
									<button class="layui-btn" >
										<a href="goodsfindbyid.do?id=${g.id}">
											<i class="layui-icon"></i>
										</a>


									</button>
									<button class="layui-btn layui-btn-danger">
										<a href="goodsdelete.do?id=${g.id}">
											<i class="layui-icon"></i>
										</a>

									</button>
							</td>


						</tr>
					</c:forEach>
						<td colspan="9" align="center">
							<div class="pagelist">
								<div id="ppp">
									第<input id="pageNum" type="text" name="page" size="2" value="${pageBean.currentPage}" />页
								</div>
								<button class="layui-btn layui-btn-sm" >
									<a href="goodslist.do?page=${pageBean.currentPage-1 gt 0 ?pageBean.currentPage-1 :1 }">
										上一页
									</a>

								</button>
								<button class="layui-btn layui-btn-sm" >
									<a href="goodslist.do?page=${pageBean.currentPage+1 lt pageBean.totalPage ? pageBean.currentPage+1 :pageBean.totalPage }">
										下一页
									</a>
								</button>
							</div>
<%--							<div class="pagelist">--%>
<%--								<div id="ppp">第--%>
<%--									<input id="pageNum" type="text" @change="gopage(page)" name="page" v-model="page" size="2" />--%>
<%--								页</div>--%>
<%--								<button class="layui-btn layui-btn-sm" @click="shang(page)">上一页</button>--%>
<%--								<button class="layui-btn layui-btn-sm" @click="xia(page)">下一页</button>--%>
<%--							</div>--%>
						</td>
						<tr>
							<td colspan="9" align="center">
								共${pageBean.totalPage}页
							</td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
	</body>
	
	<script src="./static/js/jquery-3.4.1.min.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript" src="./static/layui/layui.js"></script>
	<c:if test="${not empty msg}">
		<script type="text/javascript">
			window.onload=function (){
				alert("${msg}")
			}
			// $(function (){
			//
			// })

		</script>
	</c:if>
</html>
